﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace APMS.WebSite.Common
{
    /// <summary>
    /// AppHelper is an utility class
    /// </summary>
    /// <version>$Revision$ $Date$</version>
    /// <history>
    /// <record>10/01/2008. raQuiam - Created this file</record>
    /// </history>
    public static class AppHelper
    {
        #region Theme related
        /// <summary>
        /// Get the root of the site we are working with
        /// </summary>
        /// <returns></returns>
        public static string GetSiteRoot()
        {
            string appPath = HttpContext.Current.Request.ApplicationPath;
            if (String.IsNullOrEmpty(appPath))
                appPath = "/";
            return appPath;
        }

        public static string GetThemeName()
        {
            string themeName = ApplicationConfig.ThemeName;
            if(String.IsNullOrEmpty(themeName))
                themeName = "Default";
            return themeName;
        }

        public static string GetThemePath()
        {
            string themePath = GetSiteRoot() + "Content/" + GetThemeName() + "/";
            return themePath;
        }

        public static string GetScriptPath()
        {
            string scriptPath = GetSiteRoot() + "Content/Scripts/";
            return scriptPath;
        }
        #endregion

        #region MISC
        public static string DateTimeFormat
        {
            get
            {
                return "dddd, dd MMMM yyyy";
            }
        }

        public static string DateTimeFullFormat
        {
            get
            {
                return "dddd, dd MMMM yyyy 'at' hh:mm tt";
            }
        }
        #endregion
    }
}
